package com.p2p.auth.domain.entity;

import com.p2p.auth.common.enums.AuthMenuType;
import lombok.Data;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;
import javax.persistence.*;

/**
 * Created by Antinomy on 17/7/26.
 */
@Entity
@Table(name = "t_role_assign_menu")
@DynamicInsert
@DynamicUpdate
@EntityListeners(AuditingEntityListener.class)
@Data
public class RoleAssignMenu extends IdEntity {

    private static final long serialVersionUID = 4822130479066822011L;

    @Column(columnDefinition = "varchar(100) NOT NULL comment '唯一ID'")
    private String uniqueId;


    @Column(columnDefinition = "varchar(100) NOT NULL comment '角色ID'")
    private String roleId;

    @Column(columnDefinition = "varchar(100) NOT NULL comment '权限菜单ID'")
    private String  menuId;


    @Column(columnDefinition = "varchar(40) NOT NULL comment '菜单类型' ")
    @Enumerated(EnumType.STRING)
    private AuthMenuType menuType;

    @Column(columnDefinition = "varchar(100) comment '父菜单Id'")
    private String parentId;
}
